package com.xyl.controller;


/*
* 对于用户模块的操作，全部在该类中实现
* */

import com.xyl.service.UserService;
import com.xyl.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/user_list.action")
    public String queryUserList(Model model, HttpServletRequest request){
        List<User> list = userService.queryUserList();
        model.addAttribute("userlist",list);
        return "user_list";
    }

    @RequestMapping("/user_add.action")
    public String userAdd(){
        return "user_add";
    }

}
